/**
 * 
 */
package cl.hhha.web.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 
 * @author Óscar Álvarez V
 * @date 15-07-2009 - 16:56:04
 * @version 1.0
 */
@Entity
@Table(name="webh_menu")
public class Menu extends BaseObject implements Serializable {

	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	@Column(nullable=false, length=100)
	private String descripcion;
	
	@OneToMany(mappedBy="padre_id")
	private Set<Menu> submenus;
	
	
	@OneToOne(optional=true, mappedBy="id")
	
	private Menu padre;
	
	
	
	/* (non-Javadoc)
	 * @see cl.hhha.web.model.BaseObject#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	/* (non-Javadoc)
	 * @see cl.hhha.web.model.BaseObject#hashCode()
	 */
	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	/* (non-Javadoc)
	 * @see cl.hhha.web.model.BaseObject#toString()
	 */
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}
